<?php

use app\adminapi\middleware\JwtAuth;
use app\adminapi\middleware\OperateLog;
use app\adminapi\middleware\CheckPermission;
use think\facade\Route;

// IP黑名单路由
Route::group('ip_blacklist', function () {
    Route::get('index', 'risk.IpBlacklist/index')->name('user:list')->setOption('real_name', '获取IP黑名单列表');
    Route::get('read/:id', 'risk.IpBlacklist/read')->name('user:detail')->setOption('real_name', 'IP黑名单详情');
    Route::post('save', 'risk.IpBlacklist/save')->name('user:add')->setOption('real_name', '添加IP黑名单');
    Route::put('update/:id', 'risk.IpBlacklist/update')->name('user:update')->setOption('real_name', '编辑IP黑名单');
    Route::delete('delete/:id', 'risk.IpBlacklist/delete')->name('user:delete')->setOption('real_name', '删除IP黑名单');
})->middleware([JwtAuth::class, OperateLog::class, CheckPermission::class]);

// 风险标签
Route::group('risk_tag', function () {
    Route::get('index', 'risk.RiskTag/index')->name('user:list')->setOption('real_name', '获取风险标签列表');
    Route::get('read/:id', 'risk.RiskTag/read')->name('user:detail')->setOption('real_name', '风险标签详情');
    Route::post('save', 'risk.RiskTag/save')->name('user:add')->setOption('real_name', '添加IP黑名单');
    Route::put('update/:id', 'risk.RiskTag/update')->name('user:update')->setOption('real_name', '编辑风险标签');
    Route::delete('delete/:id', 'risk.RiskTag/delete')->name('user:delete')->setOption('real_name', '删除风险标签');
})->middleware([JwtAuth::class, OperateLog::class, CheckPermission::class]);

// 用户风险记录
Route::group('risk_records', function () {
    Route::get('index', 'risk.RiskRecords/index')->name('user:list')->setOption('real_name', '获取风险记录列表');
    Route::get('read/:id', 'risk.RiskRecords/read')->name('user:detail')->setOption('real_name', '风险记录详情');
    Route::post('save', 'risk.RiskRecords/save')->name('user:add')->setOption('real_name', '添加IP黑名单');
    Route::put('update/:id', 'risk.RiskRecords/update')->name('user:update')->setOption('real_name', '编辑风险记录');
    Route::delete('delete/:id', 'risk.RiskRecords/delete')->name('user:delete')->setOption('real_name', '删除风险记录');
})->middleware([JwtAuth::class, OperateLog::class, CheckPermission::class]);